<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateEntryTallyTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('entry_tally', function (Blueprint $table) {
            $table->increments('id');
            $table->string('order_id')->index()->comment('订单id');
            $table->unsignedInteger('courier_id')->comment('入库快递员id');
            $table->unsignedInteger('express_id')->comment('快递公司ID');
            $table->unsignedInteger('service_id')->comment('服务站ID');
            $table->unsignedInteger('network_id')->comment('网点ID');
            $table->decimal('unit_price', 10, 2)->default(0.00)->comment('单价   元/件');
            $table->unsignedTinyInteger('type')->default(1)->comment('0.派送件  1.自提件，2.寄送件');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('entry_tally');
    }
}
